<!--{template ADMIN_DIRECTORY/tpl/admin_header}-->

<div class="page_title">
	<h1>{$model_info['model_name']}{$_lang['manage']}</h1>
</div>
<!--页头结束-->
<div class="box post">
	<div class="tabcon">
		<div class="detail">
			<form method="post" action="index.php?do=$do&model_id={$model_id}&view=edit&task_id={$task_id}" id="frm_art_edit" name="frm_art_edit" enctype="multipart/form-data">
				<input type="hidden" name="task_id" value="$task_info['task_id']">
				<input type="hidden" name="model_id" value="{$model_id}">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<th colspan="2">
							该任务于
							<span style="color: red">
								<!--{eval echo date('Y-m-d  H:i:s',$task_info[start_time])}-->
							</span>
							发布，目前状态为：
							<span style="color: red">{$status_arr[$task_info['task_status']]}</span>
						</th>
					</tr>
					<tr>
						<th>任务可进行如下操作:</th>
						<td>
							{if $process_arr} {loop $process_arr $k $v}
							<button type="submit" name="sbt_act" class="positive primary button" value="{$k}" onclick="return confirm('{$_lang['confirm']}{$v}?')">
								<span class="lock icon"></span>
								{$v}
							</button>
							{/loop} {else} 无 {/if}
						</td>
					</tr>
					<tr>
						<th colspan="2">
							{loop $ops $v}
							<a href="index.php?do=$do&model_id={$model_id}&view=edit&task_id={$task_id}&op={$v}" class="button {if $op==$v}here{/if}">{$_lang['b_task_'.$v]}</a>
							{/loop}
						</th>
					</tr>
					<tr>
						<th scope="row" width="130">{$_lang['task_title']}{$_lang['zh_mh']}</th>
						<td>
							<input type="text" class="txt" name="task_title" value="$task_info['task_title']" size="80" id="task_title" msgArea="span_task_title" limit="required:true;len:2-50" msg="{$_lang['task_title_msg']}" title="{$_lang['task_title_msg']}">
							<span id="span_task_title"></span>
							&nbsp;&nbsp;&nbsp;
						</td>
					</tr>
					  {if $task_info['ext_fields']}
						  {loop $task_info['ext_fields'] $k $v}
	                      <tr>
	                        <th scope="row" width="130">{$v['f_name']}{$_lang['zh_mh']}</th>
	                        <td>
		                         <input type="text" class="txt" name="ext_fds[{$v['f_code']}]" value="{$v['data'][$v['f_code']]['content']}" size="50" 
								 {if $v['f_required']} limit="required:true"{/if} 
								 msg="{$v['f_warning']}" tips="{$v['f_tips']}" msgArea="{$v['f_code']}_msg">
	                        </td>
	                      </tr>
						  {/loop}
					  {/if}
					<tr>
						<th scope="row">发布者</th>
						<td>
							<b>{$task_info['username']}</b>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<b>{$_lang['mobile']}：{$task_info['contact']}</b>
						</td>
					</tr>
					<tr>
						<th scope="row">{if $task_info[task_status]==1||$task_info['task_status']==0} 发布时间 {else} 开始时间 {/if}{$_lang['zh_mh']}</th>
						<td>
							<!--{date('Y-m-d H:i:s',$task_info['start_time'])}-->
							&nbsp;&nbsp;
						</td>
					</tr>
					<tr>
						<th scope="row">{$_lang['contribution_end_time']}{$_lang['zh_mh']}</th>
						<td>
							<input name="txt_task_day" onclick="showcalendar(event, this, 0)" size="30" value="{$task_sub_time}" class="txt" type="text" id="txt_task_day" msgArea="span_task_day" limit="required:true;type:date" msg="日期格式错误" max="" />

							<span id="span_task_day" class="ml_5"></span>
						</td>
					</tr>
					<!--  {if $task_info[task_status]!=1&&$task_info['task_status']!=0}
				        <tr>
                        <th scope="row">{$_lang['choose_end_time']}{$_lang['zh_mh']}</th>
                        <td>
							<!--{date('Y-m-d H:i:s',$task_info['end_time'])}-->
					<!--	</td>
					  </tr>
					  {/if}-->
					<tr>
						<th scope="row">{$_lang['task_status']}{$_lang['zh_mh']}</th>
						<td>{$status_arr[$task_info['task_status']]}</td>
					</tr>
					<tr>
						<th scope="row">{$_lang['industry']}{$_lang['zh_mh']}</th>
						<td>
							<select name="slt_indus_id">
								<option value="0">{$_lang['top']}</option>
								{loop $indus_option_arr $v} {$v} {/loop}
							</select>
						</td>
					</tr>
					<tr>
						<th scope="row">{$_lang['task_attachment']}{$_lang['zh_mh']}</th>
						<td>
							<label for="upload" class="col-sm-3 control-label">上传附件</label>
							<div class="col-sm-3">
								<p class="form-control-static">
									<!--<input type="file" id="upload" name="upload">-->
									<div id="picker">上传附件</div>
									<input type="hidden" name="file_ids" id="file_ids" class="form-control" value="{$task_info['task_file']}">
								</p>
							</div>
							<div id="list" class="affix-list upload-file-list-info" style="width:210px;"></div>
							<div class="col-sm-4">
								<p class="form-control-static">每个附件不得超过{$basic_config['max_size']}M。</p>
							</div>
							<div class="col-sm-offset-3 col-sm-6">
								<ul class="affix-list upload-file-list-info" id="editFileList" style="width: 280px;">
									{if !empty($arrFileLists1)}
									 {loop $arrFileLists1 $v}
				
									<li id="edit-{$v['file_id']}" class="affix-list-item">
										<div class="upload-file-info">
											<span class="webuploader-pick-file-close" data-fileid="{$v['file_id']}" data-fileurl="{$v['save_name']}" data-queued-id="edit-{$v['file_id']}"><i class="close"></i></span>
											<span class="fname">{$v['file_name']}</span>
											<div class="clearfix"></div>
										</div>
									</li>
									{/loop} 
									{/if}
								</ul>
				
							</div>
						</td>
					</tr>
					<tr>
						<th scope="row">{$_lang['task_cash']}{$_lang['zh_mh']}</th>
						<td>
							<sapn>{$task_info['task_cash']}元</sapn>
							<input type="hidden" name="task_cash" id="task_cash" value="{$task_info['task_cash']}">
						</td>
					</tr>
					<tr>
						<th scope="row">{$_lang['task_description']}{$_lang['zh_mh']}</th>
						<td>
							<textarea  name="task_desc" id="tar_content"  cols="70">{$task_info['task_desc']}</textarea>
							 <script type="text/javascript" src="{$_K['siteurl']}/static/js/ueditor/ueditor.config.js"></script>
					<!-- 编辑器源码文件 -->
					<script type="text/javascript" src="{$_K['siteurl']}/static/js/ueditor/ueditor.all.min.js"></script>
					<script type="text/javascript" src="{$_K['siteurl']}/static/js/ueditor/lang/zh-cn/zh-cn.js"></script>
					 <!-- 实例化编辑器 -->
				    <script type="text/javascript">
				        var ue = UE.getEditor('tar_content', {
				            //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
				        	initialFrameWidth: '80%',
				        	initialFrameHeight: '400'
				        });
				    </script>
						</td>
					</tr>
					<tr>
						<th scope="row">SEO{$_lang['title']}{$_lang['zh_mh']}</th>
						<td>
							<textarea cols="70" rows="2" name="fields[seo_title]" value="{$task_info['seo_title']}">{$task_info['seo_title']}</textarea>
						</td>
					</tr>

					<tr>
						<th scope="row">SEO{$_lang['keywords']}{$_lang['zh_mh']}</th>
						<td>
							<textarea cols="70" rows="2" name="fields[seo_keyword]" value="{$task_info['seo_keyword']}">{$task_info['seo_keyword']}</textarea>
						</td>
					</tr>

					<tr>
						<th scope="row">SEO{$_lang['description']}{$_lang['zh_mh']}</th>
						<td>
							<textarea cols="70" rows="3" name="fields[seo_desc]" value="{$task_info['seo_desc']}">{$task_info['seo_desc']}</textarea>
						</td>
					</tr>
					<tr>
						<th scope="row">&nbsp;</th>
						<td>
							<button name="sbt_edit" value="1" class="positive primary  button" type="submit" onclick="return checkForm(document.getElementById('frm_art_edit'))">
								<span class="check icon"></span>
								{$_lang['submit']}
							</button>


						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</div>
<!--主体结束-->
<!--{template ADMIN_DIRECTORY/tpl/admin_footer}-->
<script type="text/javascript">
$("#taxpayerList").delegate("a","click",function() {
			var dfid = $(this).attr("data-fid");
			var pswfId = 0;
			$("#upload-queue").find('.uploadify-queue-item').each(function() {
				var fid = $(this).attr('fid');
				if (fid == dfid) {
					console.log('fid==' + fid);
					pswfId = $(this).attr('id');
					return false;
				}
			});
			if (pswfId) {
				$('#upload').uploadify('cancel',	pswfId);
			}
			deltaxpayer();
		});

    var strUrl="index.php?do=$do&model_id={$model_id}&view=edit&task_id={$task_id}";

	function sbt_payitem(){

		if($("input[temp='payitem_map']").attr("checked")==true){
			if(!$("#point").val()){
					showDialog("{$_lang['please_choose_map_area']}","alert","{$_lang['friendly_notice']}");
					return false;
			}else{
				$("#payitem_map").val("1");
			}
		}else{
			$("#payitme_map").val("");
		}

			formSub('frm_payitem','form',true);

	}

</script>
<link rel="stylesheet" type="text/css" href="{$_K['siteurl']}/admin/tpl/js/webuploader/webuploader.css">
<script type="text/javascript" src="{$_K['siteurl']}/static/js/jquery.min.js?r={RANDOM_PARA}"></script>
<script type="text/javascript" src="{$_K['siteurl']}/admin/tpl/js/webuploader/webuploader.js?r={RANDOM_PARA}"></script>
<script type="text/javascript" src="{$_K['siteurl']}/admin/tpl/js/webuploader/kppw.webuploader.js"></script>
<script type="text/javascript">
var baseurl = "{$basic_config['website_url']}";
var uploadsize = parseInt("{$basic_config['max_size']}");
	uploadsize =  isNaN(uploadsize)? 1 : uploadsize;
	$(function(){
		$("#picker").KKUploader({
				accept: {
					extensions : 'pdf,doc,docx,xls,ppt,wps,zip,rar,txt,jpg,jpeg,gif,bmp,swf,png,lsp,mp3,stl'
				},
				fileSingleSizeLimit:uploadsize*1024*1024,
				listName:'list',
				hiddenName: 'file_ids',
				editListName: 'editFileList',
			},
			{
				objType:'task',
				taskId: '{$task_id}',
				filename : 'file'
			});
	});

</script>
